﻿using CatClient.Configuration;
using System;

namespace CatClient.Fusing
{
    internal class ConFuseStatistics : FuseStatistics
    {
        public override FuseType Type
        {
            get
            {
                return FuseType.Connection;
            }
        }

        public override int Duration
        {
            get
            {
                return CatConfigManager.GetConfigObject<int>("CatConCheckDuration", 3);
            }
        }

        public override long Threshold
        {
            get
            {
                return (long)CatConfigManager.GetConfigObject<int>("CatConFuseThreshold", 3);
            }
        }

        protected override bool RecoveryCheck(long minute)
        {
            long num;
            return !this.Statistics.TryGetValue(minute, out num) || num == 0L;
        }
    }
}
